﻿namespace KingerRobot.MexicoSailunMDC.Spi;
/// <summary>
/// 出库后服务
/// </summary>
public interface IExWarehousingAfterService
{
    /// <summary>
    /// 出库后任务创建
    /// </summary>
    /// <param name="locId">位置ID</param>
    /// <param name="taskId">任务ID</param>
    long CreateTask(long locId, long taskId);

    public BizTaskBean CreateTaskV2(long locId, long taskId);
    /// <summary>
    /// 创建异常出库线体任务
    /// </summary>
    /// <param name="locId"></param>
    /// <param name="taskId"></param>
    /// <returns></returns>
    public long CreateLocOutTask(long locId, long taskId);

    /// <summary>
    /// 根据任务Id修改指定指令类型的状态（主要针对，没写入标志位的情况）
    /// </summary>
    /// <param name="taskId"></param>
    /// <param name="status"></param>
    /// <param name="type"></param>
    /// <returns></returns>
    int UpdateCmdStatusByTaskId(long? taskId, int status, int type);
    /// <summary>
    /// 出库后任务执行
    /// </summary>
    /// <param name="taskNo">任务编号</param>
    /// <param name="locId">当前位置</param>
    int ExecuteTask(int taskNo, long locId);
    /// <summary>
    /// 缓存区绑定
    /// </summary>
    /// <param name="locId"></param>
    /// <param name="taskNo"></param>
    /// <returns></returns>
    int CacheBindingLocTaskNo(long locId, int taskNo);
    /// <summary>
    /// 出库后任务完成
    /// </summary>
    /// <param name="taskNo">任务编号</param>
    /// <param name="locId">当前位置</param>
    int FinishTask(int taskNo, long locId);
    /// <summary>
    /// 出库输送完成，到达Ems取胎位
    /// </summary>
    /// <param name="productCode">条码</param>
    /// <param name="locId">位置</param>
    /// <param name="taskId">任务ID</param>
    /// <returns></returns>
    int EmsInputFinishTask(string productCode, long locId, int taskNo, long taskId);

    int CreateOrUpdateWcsOutputLog(int taskNo, int logType, string remark = "");
    /// <summary>
    /// 出库输送完成，到达Ems取胎位 有胎无信息 绑定ems异常信息
    /// </summary>
    /// <param name="locId"></param>
    /// <returns></returns>
    int EmsInputEMSAbnormalTask(long locId);


}
